home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Preview.ced
- **
- ** $VER: Preview.ced 1.1 (10.2.95)
- **
- ** This scripts shows current file using MultiView. This way a user can
- ** see text's attributes (italic, bold), colors etc. The file is shown on
- ** CEd's screen using backdrop window and CEd's font.
- ** See docs for more details.
- **
- ** This script reuires CygnusEd Professional v3.5 (or later) and Workbench
- ** 3.0 (or later) to run.
- **
- ** Copyright © 1995 Michael Letowski
- */
-
- /* Get host */
- PARSE SOURCE com res called resolved ext host .
- IF host="REXX" THEN /* From command line */
- ADDRESS "rexx_ced" /* Talk to default ced */
-
- OPTIONS RESULTS /* Enable results from commands */
- ARG windowType . /* How to show? */
-
- 'Status CURSORCOLUMN' /* Get cursor horizontal... */
- Column=RESULT+1
- 'Status CURSORLINE' /* ... and vertical position */
- Line=RESULT+1
-
- Comm="SYS:Utilities/MultiView CLIPBOARD" /* Set up command string */
-
- 'Status CLIPUNIT' /* Get clipboard unit */
- ClipUnit=RESULT
- IF ClipUnit~="" & ClipUnit~="RESULT" THEN /* Valid clip unit number */
- Comm=Comm "CLIPUNIT" RESULT /* Add to command string */
-
- 'Status PUBSCREENNAME' /* Get name of CEd's public screen */
- Screen=RESULT
- IF Screen~="" & Screen~="RESULT" THEN /* CygnusEd's screen is public */
- Comm=Comm "PUBSCREEN" Screen /* Add to command string */
-
- IF Abbrev("BACKDROP",windowType,1) & Screen="CygnusEdScreen1" THEN
- Comm=Comm "BACKDROP" /* Open as a backdrop */
-
- 'Status FONTINFO' /* Get font data */
- FontInfo=RESULT
- IF FontInfo="Topaz 80 column" THEN /* Using topaz 8 */
- Comm=Comm "FONTNAME topaz FONTSIZE 8"
- ELSE IF FontInfo="Topaz 60 column" THEN /* Using topaz 9*/
- Comm=Comm "FONTNAME topaz FONTSIZE 9"
- ELSE DO /* User-selected font */
- PARSE VAR RESULT Name ".font" Size . /* Parse it */
- IF Name~="" & Name~="RESULT" THEN /* Valid font name */
- Comm=Comm "FONTNAME" Name /* Add name to command string */
- IF Size~="" & Size~="RESULT" THEN /* Valid font name */
- Comm=Comm "FONTSIZE" Size /* Add name to command string */
- END
-
- 'DM "Copying to clipboard..."' /* Let the user know what's going on */
-
- 'Beg of file' /* Copy whole file to clipboard */
- 'Mark block'
- 'End of file'
- 'Copy block'
-
- 'LL' Line Column /* Move cursor to old position */
- 'DM "Previewing file..."' /* Change status bar again */
-
- ADDRESS COMMAND Comm /* Use MultiView to display contents of Clipboard */
-
- 'CEdToFront' /* Jump back to CEd's screen */
- 'DM' /* Restore status line */
-
- EXIT
-